<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="com.stx.crazyblog.entity.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="<%=request.getContextPath()%>/jsp/geren.js"
	language="JavaScript"></script><!--引入Js文件-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript">
 $(document).ready(function(){

   $("#focus .input_txt").each(function(){
     var thisVal=$(this).val();
     //判断文本框的值是否为空，有值的情况就隐藏提示语，没有值就显示
     if(thisVal!=""){
       $(this).siblings("span").hide();
      }else{
       $(this).siblings("span").show();
      }
     //聚焦型输入框验证 
     $(this).focus(function(){
       $(this).siblings("span").hide();
      }).blur(function(){
        var val=$(this).val();
        if(val!=""){
         $(this).siblings("span").hide();
        }else{
         $(this).siblings("span").show();
        } 
      });
    });
    $("#keydown .input_txt").each(function(){
     var thisVal=$(this).val();
     //判断文本框的值是否为空，有值的情况就隐藏提示语，没有值就显示
     if(thisVal!=""){
       $(this).siblings("span").hide();
      }else{
       $(this).siblings("span").show();
      }
      $(this).keyup(function(){
       var val=$(this).val();
       $(this).siblings("span").hide();
      }).blur(function(){
        var val=$(this).val();
        if(val!=""){
         $(this).siblings("span").hide();
        }else{
         $(this).siblings("span").show();
        }
       });
     }) ;
  })
</script>
<style type="text/css">
form {
	width: 400px;
	margin: 10px auto;
	border: solid 1px #E0DEDE;
	background: #FCF9EF;
	padding: 30px;
	box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1) inset;
}

label {
	display: block;
	height: 40px;
	position: relative;
	margin: 20px 0;
}

span {
	position: absolute;
	float: left;
	line-height: 40px;
	left: 10px;
	color: #BCBCBC;
	cursor: text;
}

.input_txt {
	width: 398px;
	border: solid 1px #ccc;
	box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1) inset;
	height: 38px;
	text-indent: 10px;
}

.input_txt:focus {
	box-shadow: 0 0 4px rgba(255, 153, 164, 0.8);
	border: solid 1px #B00000;
}

.border_radius {
	border-radius: 5px;
	color: #B00000;
}

h2 {
	font-family: "微软雅黑";
	text-shadow: 1px 1px 3px #fff;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>个人资料</title>
</head>
<body>
<div>
				<fieldset>
				<%--从session中获取当前登录对象 --%>
				<%User currentUser = (User)session.getAttribute("currentUser"); %>
				<legend>
					<%if (currentUser != null){%>
						欢迎您，<%=currentUser.getUname() %>
						<a class="btn" href="<%=request.getContextPath()%>/jsp/loginout.jsp">退出</a>
						<%}else{ %>
						请登录：
						<a class="btn" href="<%=request.getContextPath()%>/jsp/login.jsp">重新登录</a>
					<%} %>
				</legend>
					<div>	
					<%if (currentUser !=null){ %>
					<a href="<%=request.getContextPath()%>/jsp/index.jsp"></a>
					<%} %>
					</div>
			</fieldset>
</div>
=======
<span id=localtime></span>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/time.js">
</script>
	<form class="border_radius" id="focus">
		<h2>个人资料</h2>
		<label><span>请输入姓名</span><input type="text" name="name"
			class="input_txt border_radius" /></label>
		<p>
			性 别：<input type="radio" name="gender" value="boy" checked="checked"/ >男
			<input type="radio" name="gender" value="girl">女</br> </br>
		<table>
			<tr>
				<td>出 生：</td>
				<td><select id="year" onchange="changeday()" name="year">
						<option value="1"></option>
						<option value="0">2012</option>
						<option value="1">2011</option>
						<option value="0">2010</option>
						<option value="1">2009</option>
						<option value="0">2008</option>
						<option value="1">2007</option>
						<option value="0">2006</option>
						<option value="1">2005</option>
						<option value="0">2004</option>
						<option value="1">2003</option>
						<option value="0">2002</option>
						<option value="1">2001</option>
						<option value="0">2000</option>
						<option value="1">1999</option>
						<option value="0">1998</option>
						<option value="1">1997</option>
						<option value="0">1996</option>
						<option value="1">1995</option>
						<option value="0">1994</option>
						<option value="1">1993</option>
						<option value="0">1992</option>
						<option value="1">1991</option>
						<option value="0">1990</option>
						<option value="1">1989</option>
						<option value="1">1988</option>
						<option value="0">1987</option>
						<option value="1">1986</option>
						<option value="0">1985</option>
						<option value="1">1984</option>
						<option value="0">1983</option>
						<option value="1">1982</option>
						<option value="0">1981</option>
						<option value="1">1980</option>
						<option value="1">1979</option>
						<option value="0">1978</option>
						<option value="1">1977</option>
						<option value="0">1976</option>
						<option value="1">1975</option>
						<option value="0">1974</option>
						<option value="1">1973</option>
						<option value="0">1972</option>
						<option value="1">1971</option>
						<option value="1">1970</option>
						<option value="0">1969</option>
						<option value="1">1968</option>
						<option value="0">1967</option>
						<option value="1">1966</option>
						<option value="0">1965</option>
						<option value="1">1964</option>
						<option value="0">1963</option>
						<option value="1">1962</option>
				</select>年 <select id="month" name="month" onchange="changeday()">
						<option value="2"></option>

				</select>月 <select id="day" name="day">
						<option value="3"></option>
						<option value="3">1</option>
						<option value="3">2</option>
						<option value="3">3</option>
						<option value="3">4</option>
						<option value="3">5</option>
						<option value="3">6</option>
						<option value="3">7</option>
						<option value="3">8</option>
						<option value="3">9</option>
						<option value="3">10</option>
						<option value="3">11</option>
						<option value="3">12</option>
						<option value="3">13</option>
						<option value="3">14</option>
						<option value="3">15</option>
						<option value="3">16</option>
						<option value="3">17</option>
						<option value="3">18</option>
						<option value="3">19</option>
						<option value="3">20</option>
						<option value="3">21</option>
						<option value="3">22</option>
						<option value="3">23</option>
						<option value="3">24</option>
						<option value="3">25</option>
						<option value="3">26</option>
						<option value="3">27</option>
						<option value="3">28</option>
						<option value="3">29</option>
						<option value="3">30</option>
						<option value="3">31</option>
				</select>日 <script type="text/javascript" language="javascript">
                            var curdate = new Date();
                            var year = document.getElementById("year");
                            var month = document.getElementById("month");
                            var day = document.getElementById("day");
                            //绑定年份月分的默认
                            function add() {
                                var curyear = curdate.getFullYear();
                                var minyear = curyear - 80;
                                var maxyear = curyear - 18;
        for (maxyear; maxyear >= minyear; maxyear = maxyear - 1) {
                                    year.options.add(new Option(maxyear, maxyear));
                                }
                                for (var mindex = 1; mindex <= 12; mindex++) {
                                    month.options.add(new Option(mindex, mindex));
                                }
                            }

                            //判断是否是闰年
                            function leapyear(intyear) {
                                var result = false;
                                if (((intyear % 400 == 0) && (intyear % 100 != 0)) || (intyear % 4 == 0)) {
                                    result = true;
                                }
                                else {
                                    result = false;
                                }
                                return result;
                            }
                            //绑定天数
                            function addday(maxday) {
                                day.options.length = 1;
                                for (var dindex = 1; dindex <= maxday; dindex++) {
                                    day.options.add(new Option(dindex, dindex));
                                }
                            }
                            function changeday() {
                                if (year.value == null || year.value == "") {
                                    alert("请先选择年份！");
                                    return false;
                                }
                                else {
                                    if (month.value == 1 || month.value == 3 || month.value == 5 || month.value == 7 || month.value == 8 || month.value == 10 || month.value == 12) {
                                        addday(31);
                                    }
                                    else {
                                        if (month.value == 4 || month.value == 6 || month.value == 9 || month.value == 11) {
                                            addday(30);
                                        }
                                        else {
                                            if (leapyear(year.value)) {
                                                addday(29);
                                            }
                                            else {
                                                addday(28);
                                            }
                                        }
                                    }
                                }
                            }
                            window.onload = add;
                        </script></td>
			</tr>
		</table>
		</br>
		<table>
			<p>
				<tb>现居地：<select id="address" onchange="changeaddress"
					name="address"/>
					<option value="1">北京</option>
					<option value="1">河北</option>
					<option value="1">河南</option>
					<option value="1">山西</option>
					<option value="1">辽宁</option>
					<option value="1">吉林</option>
					<option value="1">黑龙江</option>
					<option value="1">江苏</option>
					<option value="1">浙江</option>
					<option value="1">安徽</option>
					<option value="1">江西</option>
					<option value="1">山东</option>
					<option value="1">湖北</option>
					<option value="1">湖南</option>
					<option value="1">广东</option>
					<option value="1">海南</option>
					<option value="1">四川</option>
					<option value="1">贵州</option>
					<option value="1">云南</option>
					<option value="1">陕西</option>
					<option value="1">甘肃</option>
					<option value="1">青海</option>
					<option value="1">台湾</option>
					<option value="1">天津</option>
					<option value="1">上海</option>
					<option value="1">重庆</option>
					<option value="1">广西</option>
					<option value="1">内蒙古</option>
					<option value="1">西藏</option>
					<option value="1">宁夏</option>
					<option value="1">新疆</option>
					<option value="1">香港</option>
					<option value="1">澳门</option></tb>
		</table>
		<br /> <label><span>请输入学校</span><input type="text"
			name="firstschool" class="input_txt border_radius" /></label> <label><span>请输入所在公司</span><input
			type="text" name="firstcompany" class="input_txt border_radius" /></label> <label><span>请输入个人简历</span><input
			type="text" name="intro" class="input_txt border_radius" /></label> <br />
		<p>
			<input type="submit" value="保存" onClick="return testAlert()"><input
				type="reset" value="重置">
			<align="rigth">
			<a href="<%=request.getContextPath()%>/jsp/mima.jsp"><input
				type="button" onclick="window.location.href='<%=request.getContextPath()%>/jsp/mima.jsp'" value="修改密码"></align>
			</a>
	</form>


</body>
</html>